<template>
	<!-- 团长，领取任务 -->
	<view>
		<view class="list_one mdx-center-min" v-for="(item,index) in list" :key='index'
			@click="$mHelper.to('/pages/my/myTeam/taskContent?id='+item.id+'&static='+item.static)">
			<view class="img_bpx">
				<view class="tag green" v-if="item.static=='可领取'">
					可领取
				</view>
				<view class="tag orange" v-if="item.static=='可发布'">
					可发布
				</view>
				<view class="tag blue" v-if="item.static=='进行中'">
					进行中
				</view>
				<view class="tag grayness" v-if="item.static=='已结束'">
					已结束
				</view>
				<view class="tag danger" v-if="item.static=='审核失败'">
					审核失败
				</view>
				<view class="tag danger" v-if="item.static=='审核中'">
					审核中
				</view>

				<u-image width="100%" height="100%" :src="item.image"></u-image>
				<view class="names mdx-center-xs">
					{{item.film_name||''}}
				</view>
			</view>
			<view class="active_title">
				{{item.activity_name||''}}
			</view>
			<view class="actEndtime">
				活动截止：{{item.end_time}}
			</view>
			<view class="u-flex price_box">
				<view class="u-flex-1 u-flex">
					<view>
						<text>最高可报:</text>
						<text class="olsf">￥</text>
						<text class="price">{{item.capital_sum}}</text>
					</view>
					<view class="u-margin-left-20">
						<text>佣金:</text>
						<text class="olsf">￥</text>
						<text class="price">{{item.ty_yj}}</text>
					</view>
				</view>
				<view class="btm_to">指定影城</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				status: 'loadmore',
				list: [],
				page: 1,
				pageSize: 10,
			}
		},
		onLoad() {
			this.getList()
		},
		onReachBottom() {
			if (this.status != 'nomore') {
				this.status = 'loading';
				setTimeout(() => {
					this.getList();
				}, 500);
			}
		},
		onPullDownRefresh() {
			setTimeout(() => {
				this.page = 1;
				this.list = [];
				this.status = 'loadmore';
				this.getList();
			}, 800);
		},
		methods: {
			getList() {
				this.$http.get('api/Tactivity/activlist', {
					page: this.page,
					limit: this.pageSize,
				}).then(res => {
					if (res.code == 0) {
						res.data.forEach(e => {
							this.list.push(e)
						})
						if (res.data.length < this.pageSize) this.status = 'nomore';
						else this.status = 'loadmore';
					}
					uni.stopPullDownRefresh();
				})
			},
		}
	}
</script>

<style lang="scss">
	page {
		background: #FAFAFA;
	}

	.list_one {
		background-color: #FFFFFF;
		margin-top: 30rpx;
		border-radius: 15rpx;
		padding-bottom: 20rpx;
		box-shadow: 0 0 10rpx #dddddd;

		.img_bpx {
			position: relative;
			height: 400rpx;
			width: 100%;

			image {
				border-radius: 15rpx 15rpx 0 0;
				width: 100%;
				height: 100%;
			}
		}

		.names {
			position: absolute;
			bottom: 10rpx;
			color: #FFFFFF;
			font-size: 32rpx;

		}

		.active_title {
			width: 90%;
			margin: 20rpx 0;
			margin-left: 5%;
			font-size: 30rpx;
			color: #333333;
			font-weight: 550;

		}

		.actEndtime {
			color: #666666;
			width: 90%;
			margin: 10rpx 0;
			margin-left: 5%;
		}

		.price_box {
			width: 90%;
			margin: 10rpx 0;
			margin-left: 5%;
			margin-top: 30rpx;
			color: #666666;

			.price {
				color: #F65151;
				font-weight: 550;
				font-size: 34rpx;
			}

			.olsf {
				color: #F65151;
				margin-left: 5rpx;
			}
		}

		.btm_to {
			background-color: #FFEC3E;
			padding: 6rpx 18rpx;
			font-size: 26rpx;
			color: #000000;
			border-radius: 50rpx;
		}
	}

	.tag {
		position: absolute;
		top: 0;
		z-index: 99;
		padding: 8rpx 18rpx;
		border-radius: 10rpx 0 10rpx 0;
		font-size: 26rpx;
	}



	.wrap {
		display: flex;
		flex-direction: column;
		height: calc(100vh - var(--window-top));
		width: 100%;
	}
</style>
